package tw.com.api;

public class ServiceImpl implements Service {

	private ShowCompent showCompent = new ShowFileCompment();

	@Override
	public void addArray(DTO dto) throws Exception {

		final String[] array = dto.getArray();

		for (int i = 0; i < array.length; i++) {
			if (array[i] == null) {
				array[i] = dto.getAddValue();
				break;
			}
		}

	}

	@Override
	public void cleanArray(DTO dto) throws Exception {
		final String[] array = dto.getArray();
		for (int i = 0; i < array.length; i++) {
			array[i] = null;
		}

	}

	@Override
	public void showArray(DTO dto) throws Exception {
		this.showCompent.show(dto.getArray());

	}

	@Override
	public void modifyArray(DTO dto) throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	public void myFunction(DTO dto) throws Exception {
		// TODO Auto-generated method stub

	}

}
